package cn.tedu.management.bill.controller;

import cn.tedu.management.bill.pojo.dto.BillInsert;
import cn.tedu.management.bill.pojo.dto.BillQuery;
import cn.tedu.management.bill.pojo.vo.BillVO;
import cn.tedu.management.bill.service.BillService;
import cn.tedu.manamgement.common.response.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@Api(tags = "缴费模块")
@RestController
@RequestMapping("/v1/bill/")
public class BillController {

    @Autowired
    BillService billService;

    @ApiOperation(value = "缴费详情功能")
    @GetMapping("selectBill")
    public JsonResult<List<BillVO>> selectBillQuery(@RequestBody BillQuery billQuery){
        log.debug("缴费详情查询:参数={}",billQuery);
         JsonResult<List<BillVO>> billVO= billService.selectBillQuery(billQuery);
        log.debug("缴费详情查询结果:参数:{}",billVO);
        return JsonResult.ok(billVO);
    }







    @ApiOperation("新增缴费功能")
    @PostMapping("insertBill")
    public JsonResult insertBill(@RequestBody BillInsert billInsert){
        log.debug("新增缴费:参数={}",billInsert);
        return JsonResult.ok(null);
    }

    @ApiOperation("编辑缴费功能")
    @PostMapping("update")
    public JsonResult updateBill(@RequestBody BillInsert billInsert){
        log.debug("编辑缴费:参数={}",billInsert);
        return JsonResult.ok(null);
    }





}
